package server.content.skills.slayer;

import core.util.Misc;
import server.game.players.Client;

public class MSlayer {

	public int task = -1, taskAmnt = -1, lastTask = -1;
	public int talkingNpc;
	private final Client c;

	private final int LOW[] = {};
	private final int LOW_MED[] = {};
	private final int MED[] = {};
	private final int HIGH[] = {};

	public MSlayer(final Client c) {
		this.c = c;
	}

	public void getTask() {
		if (hasTask())
			return;
		if (c.combatLevel >= 3 && c.combatLevel <= 29) {
			task = LOW[Misc.random(LOW.length)];
		} else if (c.combatLevel >= 30 && c.combatLevel <= 59) {
			task = LOW_MED[Misc.random(LOW_MED.length)];
		} else if (c.combatLevel >= 60 && c.combatLevel <= 89) {
			task = MED[Misc.random(MED.length)];
		} else if (c.combatLevel >= 90 && c.combatLevel <= 126) {
			task = HIGH[Misc.random(HIGH.length)];
		}
		if (lastTask == task) {
			resetTask();
			getTask();
			return;
		}
		final int amount = Misc.random(30);
		taskAmnt = amount == 0 ? 15 : amount;
	}

	public void resetTask() {
		task = taskAmnt = -1;
	}

	public boolean hasTask() {
		return task > -1 && taskAmnt > -1;
	}

}
